<template>
  <div id="app">
    <router-view v-if="isRouterAlive" />
  </div>
</template>

<script>
  import { banBackSpace } from '@/utils/ruoyi'
  //import { getCasConfig } from '@/api/system/config'

  export default {
    name: 'App',
    provide() {
      return {
        reload: this.reload,
      }
    },
    data() {
      return {
        isRouterAlive: true,
      }
    },
    mounted() {
      document.onkeypress = banBackSpace
      document.onkeydown = banBackSpace
    },
    created() {
     //getCasConfig().then((res) => {
     //  this.$store.dispatch('spsFirst/setCasLoginFlag', res.msg === '1')
     //})
    },
    methods: {
      reload() {
        this.isRouterAlive = false
        this.$nextTick(function () {
          this.isRouterAlive = true
        })
      },
    },
  }
</script>
